<?php

    require_once('../inc/Session.php');

    if( ! isset($_POST['action']) ) {
        echo '0';
    } else {
        $action = $_POST['action'];
        if( $action == 'add' ) {
            if( ! isset($_POST['product_id']) ) echo '0';
            $id = htmlentities( $_POST['product_id'] );
            add_product( $id );
            echo '1';
        } else if( $action == 'delete' ) {
            clear_products();
            echo '1';
        }
    }

?>